<template>
  <div class="mykehu_page">
    <div class="bg">
      <div class="top">
        <van-icon name="arrow-left" @click="back" />
        <van-icon name="wap-home-o" />
      </div>
      <div class="info">
        <div class="tavaget">
          <img :src="require('../assets/images/kehu/touxiang.png')" alt="" />
        </div>
        <div class="right">
          <p>名称:{{info.custName}}</p>
          <p>电话:{{info.telephone}}</p>
          <div class="xiangqing" @click="toXinxi(info.id)">
          客户信息
        </div>
        </div>
        
      </div>
    </div>

    <van-tabs v-model="active">
      <van-tab title="收入分析">
          <Shouru :dataArrs="dataArrs"/>
      </van-tab>
      <van-tab title="旗下企业">
          <Qixiaqiye :dataArrs="dataArrs"/>
      </van-tab>
      <van-tab title="合作伙伴">
        <Hezuohuoban :dataArrs="dataArrs"/>
      </van-tab>
      <van-tab title="当年收入">
        <Dangnianshouru :dataArrs="dataArrs"/>
      </van-tab>
    </van-tabs>
   
  </div>
</template>

<script>
import  Shouru from '../components/Mykehu/Shouru'
import Qixiaqiye from '../components/Mykehu/Qixiaqiye'
import Hezuohuoban from '../components/Mykehu/Hezuohuoban'
import Dangnianshouru from '../components/Mykehu/Dangnianshouru'
import {KehuShituApi} from '../request/api'
export default {
  data() {
    return {
      num: 1,
      active:0,
      info:{},
      dataArrs:[]
    };
  },
  created(){
    console.log(this.$route.params.id);
    KehuShituApi(
     this.$route.params.id
    ).then(res=>{
      console.log(res);
      this.info = res.data;
      this.dataArrs = res.data.datas;
    })
  },
  components:{
       Shouru,
       Qixiaqiye,
       Hezuohuoban,
       Dangnianshouru,
  },
  methods: {
    back() {
      this.$router.back();
    },
    toXinxi(id){
      this.$router.push('/xiangqing/'+id)
    }
  },
};
</script>

<style lang="less" scoped>
.mykehu_page {
  width: 100vw;
  height: 100vh;
  background-color: #f5f5f5;
}
.bg {
  width: 100%;
  height: 159px;
  background-color: #039;
  //   overflow: hidden;
  .top {
    width: 100%;
    height: 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 8px;
    box-sizing: border-box;
    .van-icon {
      font-size: 30px;
      color: #fff;
    }
  }
  .info {
    width: 320px;
    height: 94px;
    background-color: #fff;
    margin-left: 26px;
    margin-top: 16px;
    border-radius: 10px 10px 0 0;
    display: flex;
    align-items: center;
    .tavaget {
      width: 65px;
      height: 65px;
      border-radius: 50%;
      //   border: 1px solid #000;
      margin-left: 20px;
      margin-right: 19px;
      img {
        width: 100%;
        display: block;
      }
    }
    .right {
      p {
        &:nth-of-type(1) {
          font-weight: 700;
          margin-bottom: 7px;
        }
      }
    }
    .xiangqing{
      width: 58px;
      height: 20px;
      background-color: #fc3;
      color:#fff;
      font-size: 12px;
      line-height: 20px;
      text-align: center;
     position: absolute;
     top: 83px;
     right: 29px;
     border-radius: 10px 0 0 10px;

    }

  }
}

/deep/.van-tabs__nav{
    height: 24px;
    /deep/.van-tab{
         height: 24px;
    }
}
.nav {
  width: 100%;
  height: 54px;
  background-color: #fff;
  padding: 0 15px;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  .box {
    width: 62px;
    height: 54px;
    overflow: hidden;
    border-bottom: 2px solid transparent;
    &.active {
      border-bottom-color: yellow;
    }
    .img {
      width: 17px;
      height: 17px;
      margin: 10px 0;
      margin-left: 17px;
      img {
        width: 100%;
      }
    }
    p {
      font-size: 14px;
    }
  }
}

.content {
  display: none;
}

.content.current {
  display: block;
}
</style>